Compile on Docker/es

This documentation is not finished. Please help and contribute documentation.

GuiCommand model explains how commands should be documented. Browse Category:UnfinishedDocu to see more incomplete pages like this one. See Category:Command Reference for all commands.

See WikiPages to learn about editing the wiki pages, and go to Help FreeCAD to learn about other ways in which you can contribute.

Resumen

Entre las opciones para componer e instalar FreeCAD, existe la opción de utilizar Docker. Este método es principalmente útil para los desarrolladores de FreeCAD, utilizando ordenadores Linux o Mac OS.

Beneficios

All of FreeCAD's dependencies are already installed, compatible with each other, and configured appropriately, allowing you to get started developing very quickly.

Docker Repositorio

Prerequisitos

Instalación

Descargar la fuente

La mejor manera de obtener el código fuente de FreeCAD es clonar el repositorio Git. Para ello se necesita el programa git que puede instalarse fácilmente en la mayoría de las distribuciones de Linux y Mac OS, y también puede obtenerse en el sitio web oficial.

Esto colocará una copia de la última versión del código fuente de FreeCAD en un nuevo directorio llamado freecad_source.

git clone --recurse-submodules https://github.com/FreeCAD/FreeCAD.git ~/my_code/freecad_source

Para más información sobre el uso de Git y la contribución de código al proyecto, véase Gestión de código fuente.

Create build directory

Create a directory to hold your compiled FreeCAD source.

mkdir ~/my_code/freecad_build

Pull Docker image

Pull the Docker image. (Official image coming soon.)

docker pull registry.gitlab.com/daviddaish/freecad_docker_env:latest

Allow access to your window manager

In order for FreeCAD to launch it's GUI from within the Docker container, you need to give Docker access permissions to your window manager. In most Linux distributions, this is the X window system. You can use the below command to allow blanket access to X, until you reboot or logoff your computer.

xhost +

If you're connected to any untrusted systems, such as via ssh, this will make you vulnerable to malicious code. Either close any ssh connections, or look into more secure xhost permissions, which is outside the scope of this tutorial.

Mac OS users

For those using Mac OS, the X window system may not be installed. The XQuartz project is a long running open source project that will allow you to add it to your computer. You can find it here.

Launch the docker image

Assign environment variables so the Docker container will mount FreeCAD's source code, and build directory. In addition, you can mount an extra directory to contain any files you'd like to use for testing purposes. In the below snippet, we've left it as your home directory as a simple default.

fc_source=~/my_code/freecad_source
fc_build=~/my_code/freecad_build
other_files=~/

Launch the Docker image.

docker run -it --rm \
-v $fc_source:/mnt/source \
-v $fc_build:/mnt/build \
-v $other_files:/mnt/files \
-e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
registry.gitlab.com/daviddaish/freecad_docker_env:latest

Build FreeCAD

You can build FreeCAD using the installed build script, or using your preferred method.

/root/build_script.sh

Run FreeCAD

Once FreeCAD has been built, it can be run as normal.

/mnt/build/bin/FreeCAD

You can find the attached directories in the /mnt directory.

Discussion

Related